/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* 控制面板样式 */
.control-panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.control-panel h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

/* 图表类型选择器 */
.chart-type-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.chart-type-btn {
    padding: 12px 20px;
    border: 2px solid #e1e8ed;
    background: white;
    color: #555;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chart-type-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.chart-type-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 数据输入区域 */
.data-input {
    margin-bottom: 30px;
}

.data-sets {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.data-sets::-webkit-scrollbar {
    width: 6px;
}

.data-sets::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.data-sets::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.data-sets::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.data-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.data-set label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.data-set input[type="text"],
.data-set input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.data-set input[type="color"] {
    width: 100%;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.add-btn {
    width: 100%;
    padding: 10px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* 图表选项 */
.chart-options {
    margin-bottom: 20px;
}

.option-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group label {
    font-size: 0.95rem;
    color: #555;
    flex: 1;
}

.option-group input[type="text"] {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 图表容器 */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
}

#chartCanvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* 底部样式 */
footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.control-panel,
.chart-container {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .chart-container {
        padding: 20px;
        min-height: 400px;
    }
    
    .data-set {
        grid-template-columns: 1fr;
    }
    
    #chartCanvas {
        width: 100%;
        height: auto;
    }
}